﻿using System;
using System.IO.Compression;
using System.Linq;
using Foundation;

namespace FileCompressor
{
    class Program
    {
        private static void Main(string[] args)
        {
            try
            {
                args.Where(n => !n.ToLower().Contains(".compressed"))
                    .ToList()
                    .ForEach(n => Compressor.ConvertFile(n, CompressionMode.Compress));
                args.Where(n => n.ToLower().Contains(".compressed"))
                    .ToList()
                    .ForEach(n => Compressor.ConvertFile(n, CompressionMode.Decompress));
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception.Message);
                Console.ReadKey();
            }
        }
    }
}
